<Students>
{for $res in doc("responses.xml")/CLASS/STUDENT/RESPONSES
return <Student who="{$res/@answeredBy}" year="{data($res/NRESPONSE[@qID="year"])}"/>}
</Students>